(0) Obligation:

Clauses:

sameleaves(leaf(L), leaf(L)).
sameleaves(tree(T1, T2), tree(S1, S2)) :- ','(getleave(T1, T2, L, T), ','(getleave(S1, S2, L, S), sameleaves(T, S))).
getleave(leaf(A), C, A, C).
getleave(tree(A, B), C, L, O) :- getleave(A, tree(B, C), L, O).

Query: sameleaves(g,g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

getleaveA(leaf(T42), T43, T42, T43).
getleaveA(tree(T52, T53), T54, T55, X63) :- getleaveA(T52, tree(T53, T54), T55, X63).
pB(leaf(T23), T24, T23, T24, T13, T14, X17) :- getleaveA(T13, T14, T23, X17).
pB(leaf(T23), T24, T23, T24, T13, T14, T29) :- ','(getleaveA(T13, T14, T23, T29), sameleavesC(T24, T29)).
pB(tree(T70, T71), T72, X89, X90, T13, T14, X17) :- pB(T70, tree(T71, T72), X89, X90, T13, T14, X17).
sameleavesC(leaf(T6), leaf(T6)).
sameleavesC(tree(T11, T12), tree(T13, T14)) :- pB(T11, T12, X15, X16, T13, T14, X17).

Query: sameleavesC(g,g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
sameleavesC_in: (b,b)
pB_in: (b,b,f,f,b,b,f)
getleaveA_in: (b,b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → U6_GG(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_GGAAGGA(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → GETLEAVEA_IN_GGGA(T13, T14, T23, X17)
GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → U1_GGGA(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55, X63)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_GGAAGGA(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → SAMELEAVESC_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_GGAAGGA(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVESC_IN_GG(x1, x2)  =  SAMELEAVESC_IN_GG(x1, x2)
U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x5)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U2_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGA(x1, x2, x6)
GETLEAVEA_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEA_IN_GGGA(x1, x2, x3)
U1_GGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGA(x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGA(x1, x2, x5, x6)
U5_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_GGAAGGA(x9)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → U6_GG(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_GGAAGGA(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, X17) → GETLEAVEA_IN_GGGA(T13, T14, T23, X17)
GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → U1_GGGA(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55, X63)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_GGAAGGA(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → SAMELEAVESC_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_GGAAGGA(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVESC_IN_GG(x1, x2)  =  SAMELEAVESC_IN_GG(x1, x2)
U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x5)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U2_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGA(x1, x2, x6)
GETLEAVEA_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEA_IN_GGGA(x1, x2, x3)
U1_GGGA(x1, x2, x3, x4, x5, x6)  =  U1_GGGA(x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)
U4_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGA(x1, x2, x5, x6)
U5_GGAAGGA(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_GGAAGGA(x9)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 6 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55, X63)

The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
GETLEAVEA_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEA_IN_GGGA(x1, x2, x3)

We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55, X63) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55, X63)

R is empty.
The argument filtering Pi contains the following mapping:
tree(x1, x2)  =  tree(x1, x2)
GETLEAVEA_IN_GGGA(x1, x2, x3, x4)  =  GETLEAVEA_IN_GGGA(x1, x2, x3)

We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GETLEAVEA_IN_GGGA(tree(T52, T53), T54, T55) → GETLEAVEA_IN_GGGA(T52, tree(T53, T54), T55)
    The graph contains the following edges 1 > 1, 3 >= 3

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → SAMELEAVESC_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

sameleavesC_in_gg(leaf(T6), leaf(T6)) → sameleavesC_out_gg(leaf(T6), leaf(T6))
sameleavesC_in_gg(tree(T11, T12), tree(T13, T14)) → U6_gg(T11, T12, T13, T14, pB_in_ggaagga(T11, T12, X15, X16, T13, T14, X17))
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17) → U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_in_ggga(T13, T14, T23, X17))
getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)
U2_ggaagga(T23, T24, T13, T14, X17, getleaveA_out_ggga(T13, T14, T23, X17)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, X17)
pB_in_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_ggaagga(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_in_gg(T24, T29))
U4_ggaagga(T23, T24, T13, T14, T29, sameleavesC_out_gg(T24, T29)) → pB_out_ggaagga(leaf(T23), T24, T23, T24, T13, T14, T29)
pB_in_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17) → U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_in_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17))
U5_ggaagga(T70, T71, T72, X89, X90, T13, T14, X17, pB_out_ggaagga(T70, tree(T71, T72), X89, X90, T13, T14, X17)) → pB_out_ggaagga(tree(T70, T71), T72, X89, X90, T13, T14, X17)
U6_gg(T11, T12, T13, T14, pB_out_ggaagga(T11, T12, X15, X16, T13, T14, X17)) → sameleavesC_out_gg(tree(T11, T12), tree(T13, T14))

The argument filtering Pi contains the following mapping:
sameleavesC_in_gg(x1, x2)  =  sameleavesC_in_gg(x1, x2)
leaf(x1)  =  leaf(x1)
sameleavesC_out_gg(x1, x2)  =  sameleavesC_out_gg
tree(x1, x2)  =  tree(x1, x2)
U6_gg(x1, x2, x3, x4, x5)  =  U6_gg(x5)
pB_in_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_in_ggaagga(x1, x2, x5, x6)
U2_ggaagga(x1, x2, x3, x4, x5, x6)  =  U2_ggaagga(x1, x2, x6)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
pB_out_ggaagga(x1, x2, x3, x4, x5, x6, x7)  =  pB_out_ggaagga(x3, x4, x7)
U3_ggaagga(x1, x2, x3, x4, x5, x6)  =  U3_ggaagga(x1, x2, x6)
U4_ggaagga(x1, x2, x3, x4, x5, x6)  =  U4_ggaagga(x1, x2, x5, x6)
U5_ggaagga(x1, x2, x3, x4, x5, x6, x7, x8, x9)  =  U5_ggaagga(x9)
SAMELEAVESC_IN_GG(x1, x2)  =  SAMELEAVESC_IN_GG(x1, x2)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)

We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, X15, X16, T13, T14, X17)
PB_IN_GGAAGGA(leaf(T23), T24, T23, T24, T13, T14, T29) → U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_in_ggga(T13, T14, T23, T29))
U3_GGAAGGA(T23, T24, T13, T14, T29, getleaveA_out_ggga(T13, T14, T23, T29)) → SAMELEAVESC_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, X89, X90, T13, T14, X17) → PB_IN_GGAAGGA(T70, tree(T71, T72), X89, X90, T13, T14, X17)

The TRS R consists of the following rules:

getleaveA_in_ggga(leaf(T42), T43, T42, T43) → getleaveA_out_ggga(leaf(T42), T43, T42, T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55, X63) → U1_ggga(T52, T53, T54, T55, X63, getleaveA_in_ggga(T52, tree(T53, T54), T55, X63))
U1_ggga(T52, T53, T54, T55, X63, getleaveA_out_ggga(T52, tree(T53, T54), T55, X63)) → getleaveA_out_ggga(tree(T52, T53), T54, T55, X63)

The argument filtering Pi contains the following mapping:
leaf(x1)  =  leaf(x1)
tree(x1, x2)  =  tree(x1, x2)
getleaveA_in_ggga(x1, x2, x3, x4)  =  getleaveA_in_ggga(x1, x2, x3)
getleaveA_out_ggga(x1, x2, x3, x4)  =  getleaveA_out_ggga(x4)
U1_ggga(x1, x2, x3, x4, x5, x6)  =  U1_ggga(x6)
SAMELEAVESC_IN_GG(x1, x2)  =  SAMELEAVESC_IN_GG(x1, x2)
PB_IN_GGAAGGA(x1, x2, x3, x4, x5, x6, x7)  =  PB_IN_GGAAGGA(x1, x2, x5, x6)
U3_GGAAGGA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGA(x1, x2, x6)

We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, T13, T14)
PB_IN_GGAAGGA(leaf(T23), T24, T13, T14) → U3_GGAAGGA(T23, T24, getleaveA_in_ggga(T13, T14, T23))
U3_GGAAGGA(T23, T24, getleaveA_out_ggga(T29)) → SAMELEAVESC_IN_GG(T24, T29)
PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleaveA_in_ggga(leaf(T42), T43, T42) → getleaveA_out_ggga(T43)
getleaveA_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleaveA_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleaveA_out_ggga(X63)) → getleaveA_out_ggga(X63)

The set Q consists of the following terms:

getleaveA_in_ggga(x0, x1, x2)
U1_ggga(x0)

We have to consider all (P,Q,R)-chains.

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

PB_IN_GGAAGGA(leaf(T23), T24, T13, T14) → U3_GGAAGGA(T23, T24, getleaveA_in_ggga(T13, T14, T23))
U3_GGAAGGA(T23, T24, getleaveA_out_ggga(T29)) → SAMELEAVESC_IN_GG(T24, T29)
The following rules are removed from R:

getleaveA_in_ggga(leaf(T42), T43, T42) → getleaveA_out_ggga(T43)
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(PB_IN_GGAAGGA(x1, x2, x3, x4)) = 2·x1 + 2·x2 + 2·x3 + 2·x4   
POL(SAMELEAVESC_IN_GG(x1, x2)) = 2·x1 + 2·x2   
POL(U1_ggga(x1)) = x1   
POL(U3_GGAAGGA(x1, x2, x3)) = 1 + x1 + 2·x2 + x3   
POL(getleaveA_in_ggga(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(getleaveA_out_ggga(x1)) = 2·x1   
POL(leaf(x1)) = 2 + 2·x1   
POL(tree(x1, x2)) = x1 + x2   

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SAMELEAVESC_IN_GG(tree(T11, T12), tree(T13, T14)) → PB_IN_GGAAGGA(T11, T12, T13, T14)
PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleaveA_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleaveA_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleaveA_out_ggga(X63)) → getleaveA_out_ggga(X63)

The set Q consists of the following terms:

getleaveA_in_ggga(x0, x1, x2)
U1_ggga(x0)

We have to consider all (P,Q,R)-chains.

(23) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(24) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

The TRS R consists of the following rules:

getleaveA_in_ggga(tree(T52, T53), T54, T55) → U1_ggga(getleaveA_in_ggga(T52, tree(T53, T54), T55))
U1_ggga(getleaveA_out_ggga(X63)) → getleaveA_out_ggga(X63)

The set Q consists of the following terms:

getleaveA_in_ggga(x0, x1, x2)
U1_ggga(x0)

We have to consider all (P,Q,R)-chains.

(25) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(26) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

R is empty.
The set Q consists of the following terms:

getleaveA_in_ggga(x0, x1, x2)
U1_ggga(x0)

We have to consider all (P,Q,R)-chains.

(27) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

getleaveA_in_ggga(x0, x1, x2)
U1_ggga(x0)

(28) Obligation:

Q DP problem:
The TRS P consists of the following rules:

PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(29) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • PB_IN_GGAAGGA(tree(T70, T71), T72, T13, T14) → PB_IN_GGAAGGA(T70, tree(T71, T72), T13, T14)
    The graph contains the following edges 1 > 1, 3 >= 3, 4 >= 4

(30) YES